package NGUYENVANDOAN.OOP.DEMO;

public class Tringle {   
  //1. Datafield
    private double side01;
    private double side02;
    private double side03;
    
    //2. Constructors
    public Tringle(){
        side01 = 1.0;
        side02 = 1.0;
        side03 = 1.0;
    }
    
    public Tringle(double side01, double side02, double side03){
        this.side01 = side01;
        this.side02 = side02;
        this.side03 = side03;
    }
    
    //3. Thuộc tính
    /**
     * @return the side01
     */
    public double getSide01() {
        return side01;
    }

    /**
     * @param side01 the side01 to set
     */
    public void setSide01(double side01) {
        this.side01 = side01;
    }

    /**
     * @return the side02
     */
    public double getSide02() {
        return side02;
    }

    /**
     * @param side02 the side02 to set
     */
    public void setSide02(double side02) {
        this.side02 = side02;
    }

    /**
     * @return the side03
     */
    public double getSide03() {
        return side03;
    }

    /**
     * @param side03 the side03 to set
     */
    public void setSide03(double side03) {
        this.side03 = side03;
    }
    
    //4. Phương thức
    public double Area(){
        double a = (side01 + side02 + side03)/2;        
        return Math.sqrt(a *(a - side01) *(a - side02) * (a - side03));
    }    
}
